/*
 * Developer : Jack Matthews
 * Email: developer@droidprofessor.com
 * 
 * Copyright (C) 2010 http://droidprofessor.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.droidprofessor.android.library.phonelicenses;

/**
 * 
 * @author Jack Matthews
 * 
 * 
 */
class XmlResponse<T> {
	private final String type;
	private final int httpCode;
	private final String message;
	private T obj;
	
	XmlResponse(int httpCode, String type, String message) {
		this.type = type;
		this.httpCode = httpCode;
		this.message = message;
	}

	String getType() {
		return type;
	}

	int getHttpCode() {
		return httpCode;
	}

	String getMessage() {
		return message;
	}
	
	boolean isError() {
		return !( this.type.toLowerCase().equals("ok") );
	}
	
	T getObject() {
		return this.obj;
	}
	
	void setObject(T object) {
		this.obj = object;
	}

	@Override
	public String toString() {
		return "type="+type+" ,httpCode="+httpCode+" ,message="+message+" [Object="+obj+"]";
	}

}
